JavaScript:Canvas API
code:script.js
// 表示領域を作る
const editor = document.getElementById('editor');
editor.insertAdjacentHTML('beforeend',`
<canvas id="canvas" style="width:600px;height:500px;" >
</canvas>
`);
const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');
ctx.fillStyle = 'green';
ctx.fillRect(10, 10, 150, 100);
js-script-button.icon(実行ボタン)
JavaScript.icon
https://img.shields.io/badge/JavaScript-Canvas_API-F7DF1E.svg?logo=javascript&style=for-the-badge
MDN.icon